Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get make of Device

3 views
Skip to first unread message

Peter B

unread,
Jan 21, 2004, 10:50:33 AM1/21/04
to
Is there an easy and generic way of getting the make of a device? I.e. Dell,
Compaq/HP, Intermec etc...


Paul G. Tobey [eMVP]

unread,
Jan 21, 2004, 12:33:10 PM1/21/04
to
I don't see any generic way provided by the OS to query that information.
If it exists, it would be Pocket PC-specific. Of course, if you have some
type of network card in every device, you can look at the Ethernet address,
the first three bytes of which indicate who made the card.

Paul T.

"Peter B" <pe...@data.se> wrote in message
news:%23OuNeZD...@tk2msftngp13.phx.gbl...

Darren Beckley

unread,
Jan 21, 2004, 5:18:57 PM1/21/04
to
You can P/Invoke SystemParametersInfo() with parameter SPI_GETOEMINFO to
retrieve a string defined by each OEM to identify their device. As there is
no particular format for this string, you will have to try this function on
each type of device that you wish to check for and make a note of the
strings that get returned.

For an example in C++, see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k/html/ppc_hpocket.asp.

Hope that helps,
Darren

"Peter B" <pe...@data.se> wrote in message
news:%23OuNeZD...@tk2msftngp13.phx.gbl...

Peter B

unread,
Jan 22, 2004, 3:48:34 AM1/22/04
to
Thanks!


"Darren Beckley" <darren....@nointermecspam.com> wrote in message
news:%23J4aKyG...@TK2MSFTNGP11.phx.gbl...

chora

unread,
Jan 27, 2004, 8:41:35 AM1/27/04
to

Any C# sample code?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Peter B

unread,
Jan 27, 2004, 10:02:58 AM1/27/04
to
The following class contains two functions to retrive the Platform and
OEMInfo string. The OEMInfo string usually contains the make of the device.
Put it in a code editor because the formatting is probably screwed...

public class MyWinAPI

{

private MyWinAPI()

{

//

// TODO: Add constructor logic here

//

}

internal const int SPI_GETPLATFORMTYPE = 257;

internal const int SPI_GETOEMINFO = 258;

[DllImport("coredll.dll")]

internal static extern int SystemParametersInfo (

int uiAction,

int uiParam,

string pvParam,

int fWinIni );

public enum Platform

{

PocketPC2000,

PocketPC2002,

PocketPC2003,

Unknown

}

public static Platform GetPlatform()

{

string szPlatform = " ";

string strPlatform = "";

//Get OSVersion

System.OperatingSystem osVersion = Environment.OSVersion;

// Get Platform

int ret = SystemParametersInfo(SPI_GETPLATFORMTYPE, szPlatform.Length ,
szPlatform, 0);

if (ret != 0)

{

strPlatform = szPlatform.Substring(0, szPlatform.IndexOf('\0'));

}

if (osVersion.Version.Major == 3) //PPC2000 or PPC2002

{

if (strPlatform == "PocketPC")

return Platform.PocketPC2002;

else

return Platform.PocketPC2000;

}

else if (osVersion.Version.Major == 4) //WinCE.NET

{

if (strPlatform == "PocketPC")

return Platform.PocketPC2003;

else

return Platform.Unknown;

}


return Platform.Unknown;


}

public static string GetOEMInfo()

{

string szOEMInfo = " ";

string strOEMInfo = "";


// Get OEM Info

int ret = SystemParametersInfo(SPI_GETOEMINFO, szOEMInfo.Length , szOEMInfo,
0);

if (ret != 0)

{

strOEMInfo = szOEMInfo.Substring(0, szOEMInfo.IndexOf('\0'));

}

return strOEMInfo;


}

}

"chora" <cho...@hotmail.com> wrote in message
news:uPTHJtN5...@TK2MSFTNGP11.phx.gbl...

chora

unread,
Jan 27, 2004, 1:02:46 PM1/27/04
to

Thanks a LOT!

In the meantime I discovered that in most cases the Vendor name is in
the registry under LOCAL_MACHINE\Platform.

Peter B

unread,
Jan 28, 2004, 4:33:32 AM1/28/04
to
Indeed it is..


"chora" <cho...@hotmail.com> wrote in message

news:exk2F$P5DHA...@TK2MSFTNGP09.phx.gbl...

Peter B

unread,
Jan 28, 2004, 7:51:31 AM1/28/04
to
Investigating it abit further I only got 1 out of 3 to display the make of
the device.

HKEY_LOCAL_MACHINE->Platform->Name

Device value
Intermec "Intermec 740"
Dell "Microsoft Windows CE Hardware Reference Platform"
iPAQ "Microsoft Windows CE Hardware Reference Platform"

/ Peter

"chora" <cho...@hotmail.com> wrote in message

news:exk2F$P5DHA...@TK2MSFTNGP09.phx.gbl...

chora

unread,
Jan 28, 2004, 12:18:12 PM1/28/04
to

Sorry if that "most cases" was misleading. At the office we use mostly
Symbol and Intermec and I only checked
several models of these two vendors.

0 new messages